import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;


public class Dbg {
	
	private static boolean enabled = false;
	private static PrintWriter clientOut;
	private static PrintWriter serverOut;
	
	public static void setEnabled(boolean e) {
		enabled = e;
	}
	
	public static void print(Object o) {
		if (enabled) System.out.print(o);
	}
	
	public static void println() {
		if (enabled) System.out.println();
	}
	
	public static void println(Object o) {
		print(o);
		println();
	}
	
	public static void setupLogs() {
		try {
			clientOut = new PrintWriter(new File("clientReceive.txt"));
			serverOut = new PrintWriter(new File("serverReceive.txt"));
		} catch (FileNotFoundException e1) {
			e1.printStackTrace();
		}
	}
	
	public static void serverLog(Object o) {
			serverOut.println(o);
			serverOut.flush();
	}
	
	public static void clientLog(Object o) {
			clientOut.println(o);
			clientOut.flush();
	}
	
}


